<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 100%;
        height: 500px;
        position: relative;
        border: 1px solid #eee;
        background-color: pink;
      }

      .demo {
        width: 100px;
        height: 100px;
        background-color: #f00;
        position: absolute;
        left: 100px;
        top: 100px;
        /*-webkit-transform: rotate(0deg);
        -moz-transform: rotate(0deg);
        -ms-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        transform: rotate(0deg);*/

        /*left属性使用过渡动画*/
        -webkit-transition: left 3s;
        -moz-transition: left 3s;
        -ms-transition: left 3s;
        -o-transition: left 3s;
        transition: left 3s; /*支持W3C的浏览器*/

        /*宽度属性使用过度动画*/
        -webkit-transition: width 3s;
        -moz-transition: width 3s;
        -ms-transition: width 3s;
        -o-transition: width 3s;
        transition: width 3s;

        /*全部属性使用过度动画*/
        /*-webkit-transition: all 3s;*/
        /*-moz-transition: all 3s;*/
        /*-ms-transition: all 3s;*/
        /*-o-transition: all 3s;*/
        /*transition: all 3s;*/

        /*设置动画变速：先慢再快最后慢  动画延迟500ms后再出现*/
        -webkit-transition: all 3s ease 500ms;
        -moz-transition: all 3s ease 500ms;
        -ms-transition: all 3s ease 500ms;
        -o-transition: all 3s ease 500ms;
        transition: all 3s ease 500ms;

        /*分开设置left和width的动画效果*/
        /*-webkit-transition: left 3s ease 500ms, width 5s ease-in-out;
        -moz-transition: left 3s ease 500ms, width 5s ease-in-out;
        -ms-transition: left 3s ease 500ms, width 5s ease-in-out;
        -o-transition: left 3s ease 500ms, width 5s ease-in-out;
        transition: left 3s ease 500ms, width 5s ease-in-out;*/
      }

      .box:hover .demo {
        /*过渡动画属性*/
        left: 500px;
        top: 200px;
        width: 300px;
        background-color: aqua;

        /*加旋转*/
        -webkit-transform: rotate(60deg);
        -moz-transform: rotate(60deg);
        -ms-transform: rotate(60deg);
        -o-transform: rotate(60deg);
        transform: rotate(60deg);
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="demo"></div>
    </div>
  </body>
</html>
